1. Field of the Invention
The present invention relates to a microcomputer capable of effectively storing data like user programs (briefly referred to as "user programs" below) in a flash memory incorporated in the microcomputer.
2. Description of Related Art
FIG. 6 is a block diagram showing a configuration of a conventional microcomputer. In this figure, the reference numeral 1 designates a microcomputer including a RAM 2 and a flash memory 3. The flash memory 3 includes a boot program area 3a and a user program area 3b as shown in FIG. 7. The boot program area 3a is provided for storing a boot program used for loading user programs, and the user program area 3b is provided for storing the user programs.
The reference numeral 4 designates a CPU, 5 designates a serial interface (abbreviated to SIO from now on) of the microcomputer 1, 6 designates an internal bus of the microcomputer 1, and 7 designates an external host computer. The CPU 4 executes the boot program stored in the boot program area 3a of the flash memory 3 to load the user programs into the user program area 3b of the flash memory 3. The user programs are received from the host computer 7 through the SIO 5, and stored in the user program area 3b of the flash memory 3.
Next, the operation will be described.
A user can freely store the user programs in the user program area 3b of the flash memory 3 in the microcomputer 1.
A procedure for storing the user programs in the user program area 3b of the flash memory 3 will now be described.
First, the CPU 4 sets its program counter at the beginning address of the boot program area 3a to start the boot program which has been stored in the boot program area 3a of the flash memory 3.
Starting the boot program, the CPU 4 receives the user programs from the host computer 7 through the SIO 5 in accordance with the boot program, and stores the user programs into the user program area 3b of the flash memory 3.
Thus, the conventional microcomputer can load the user programs into the user program area 3b of the flash memory 3 by executing the boot program stored in the boot program area 3a of the flash memory 3. However, since the boot program must be prestored in the boot program area 3a of the flash memory 3, the user programs cannot use the entire area of the flash memory 3.
Japanese patent application laid-open No. 7-49852 (1995) discloses a technique in which the CPU 4 receives the boot program from the host computer 7. This technique, however, has a problem in that it must prestore a load program for receiving the boot program in the flash memory 3, and so it cannot release the entire area of the flash memory 3 as the user program area 3b.